package system

import (
	"github.com/gogf/gf/v2/frame/g"
	"github.com/sagoo-cloud/sagooiot/internal/model"
)

type LoginDoReq struct {
	g.Meta    `path:"/login" method:"post" summary:"执行登录请求" tags:"登录"`
	UserName  string `json:"userName" v:"required#请输入账号"   dc:"账号"`
	Password  string `json:"password" v:"required#请输入密码"   dc:"密码"`
	Captcha   string `json:"captcha"  v:"required#请输入验证码" dc:"验证码"`
	VerifyKey string `json:"verifyKey"`
}
type LoginDoRes struct {
	UserInfo *model.LoginUserRes `json:"userInfo"`
	Token    string              `json:"token"`
}

type LoginOutReq struct {
	g.Meta `path:"/loginOut" method:"post" summary:"退出" tags:"登录"`
}
type LoginOutRes struct {
}

type OauthReq struct {
	g.Meta   `path:"/oauth" method:"post" summary:"第三方登录" tags:"登录"`
	Code     string `json:"code" dc:"第三方返回的code" v:"required#code必填"`
	State    string `json:"state" dc:"第三方返回的state" `
	Types    string `json:"types" dc:"gitee或qq或github或wechat" v:"in:github,qq,gitee,wechat"`
	IsCreate int    `json:"isCreate" v:"required#请填写是否绑定账号" dc:"是否绑定账号:0(否),创建新账号,1(是)绑定已有账号"`
}
type OauthRes struct {
	UserInfo    *model.LoginUserRes `json:"userInfo"`
	Token       string              `json:"token"`
	OauthUserId int                 `json:"oauthUserId" dc:"OauthUserId授权用户id,绑定账号时传递"`
}

type BindSysUserReq struct {
	g.Meta      `path:"/bind_oauth_user" method:"post" summary:"绑定已有账号gitee 登录" tags:"登录"`
	UserName    string `json:"userName" v:"required#请输入账号"   dc:"账号"`
	Password    string `json:"password" v:"required#请输入密码"   dc:"密码"`
	OauthUserId int    `json:"oauthUserId" v:"required#请输入绑定账号" dc:"OauthUserId授权用户id,绑定账号时传递"`
}
type BindSysUserRes struct {
	UserInfo *model.LoginUserRes `json:"userInfo"`
	Token    string              `json:"token"`
}
